package demo02;

import java.util.LinkedList;
import java.util.Queue;

public class demo5 {
    public static void main(String[] args) {
        Queue<Integer> queue = new LinkedList<>();
        queue.add(1);
        queue.add(2);
        queue.add(3);
        queue.add(4);
        System.out.println("queue.peek(): "+queue.peek());
        queue.poll();
        System.out.println("queue.isEmpty(): "+queue.isEmpty());

        while(!queue.isEmpty()){
            System.out.println(queue.poll());
        }
    }
}
